<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>缤格</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/binge.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/swiper.min.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>

<body>
<div class="match-status bg-cover" id="match_bg" style="background: url('../../image/bg-match-logo.png')">
    <div id="header" style="height: 0.9rem; position: absolute; top: 0;left: 0; width: 100%; z-index: 99">
        <!-- header -->
        <div class="header">
            <div class="head-back">
                <a href="javascript:void(0);" tapmode onclick="comeBack()" class="back-btn-white"></a>
            </div>
            <!--<div class="head-title" style="width: calc(100% - 1rem)">-->
            <!--<h6 style="color: #fff; font-size: 0.28rem;" class="t-l">高校足球赛1/8决赛</h6>-->
            <!--</div>-->
            <div class="head-action">
                <a href="javascript:void(0);" tapmode onclick="addRemind(this)" class="action-btn-ld"></a>
            </div>
        </div>
        <!-- header end -->
    </div>


    <div class="match-battle">
        <div class="match-li" style="padding-top: 0;">
            <div class="match-school" id="team1" onclick="teamDetail(this)">
                <div class="match-school-logo bg-cover" id="team1_icon" style="background: url('../../icon/Icon.png')"></div>
                <p class="school-name" id="team1_name">球队名称</p>
            </div>
            <div class="match-detail">
                <p class="match-place single-ellipsis" id="match_time">09:30 10-21</p>
                <h6 class="match-title multiline-ellipsis" id="match_name">决赛</h6>
                <div class="match-num" id="match_score">12 - 14</div>
                <div class="play-status status1" id="match_status" onclick="toUrlvideo()"><span id="match_status_text">直播中</span></div>
            </div>
            <div class="match-school" id="team2" onclick="teamDetail(this)">
                <div class="match-school-logo bg-cover" id="team2_icon" style="background: url('../../icon/Icon.png')"></div>
                <p class="school-name" id="team2_name">球队名称</p>
            </div>
        </div>
    </div>

    <div class="match_view">
        <div class="match_video zy_media">
            <!--<video id="video" poster="../../image/banner01.png">
                <source src="../../icon/20190508110623.mp4" type="video/mp4" />
            </video>-->
        </div>
        <span class="video_close">关闭</span>
    </div>
</div>

<div class="match-detail-show">
    <ul>
        <li><a href="javascript:void(0);">评论</a></li>
        <li class="on"><a href="javascript:void(0);">赛况</a></li>
        <li><a href="javascript:void(0);">阵容</a></li>
    </ul>
</div>

<div class="match-section">
    <div class="section" style="display: none">
        <div class="comment-area">
            <div class="comment-list area">
                <ul id="commentHtml">


                </ul>
                <div class="comment-input">
                    <div class="input-box">
                        <input type="text" id="inputContent" readonly data-pid="" placeholder="写评论...">
                        <!--<button class="send-btn" tapmode onclick="comment_add()">确定</button>-->
                    </div>
                    <div class="comment-count">
                        <div class="count-li collect" id="collect" tapmode onclick="collect(this)">0</div>
                        <div class="count-li love" id="love" tapmode onclick="clickFabulous('',5,'',event)">0</div>
                        <div class="count-li msg" id="msg" tapmode onclick="toAllList()">0</div>
                    </div>
                </div>

                <div class="edit-model">
                    <div class="edit-input">
                        <div class="message-flex">
                            <div class="message-box" id="message">
                                <div class="message" id="article" contenteditable="true"></div>
                            </div>
                            <div class="message-img" style="display: none;" id="msgImg">
                                <img src="" alt="">
                                <span class="delete dn" tapmode onclick="removePic(this,event)"></span>
                            </div>
                        </div>

                        <div class="But">
                            <div class="but-list">
                                <a href="javascript:void(0);" tapmode onclick="upload()" class="imgBut"></a>
                                <a href="javascript:void(0);" tapmode onclick="showVideo()" class="videoBut"></a>
                                <a href="javascript:void(0);" tapmode onclick="toAiteList()" class="aiTeBut"></a>
                            </div>
                            <span class="submit" tapmode onclick="comment_add()">确定</span>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <div class="section" style="display: block">
        <div class="match-outs">
            <div class="common-title">
                <h6>战况</h6>
                <a href="javascript:void(0);" tapmode onclick="situation('match_situation_list')" class="more">更多></a>
            </div>
            <div class="war-list" id="war">
                <!--<div class="outs-detail" tapmode onclick="commonUrl('match_detail')">
                    <div class="outs-img bg-cover" style="background: url('../../image/img-activity.png');"></div>
                    <div class="outs-info">
                        <p class="multiline-ellipsis_3 info">篮球比赛即根据篮球运动进行的比赛。篮球比赛的形式多种多样，有较为常见的五人篮球。</p>
                        <div class="flex-div">
                            <p>15分钟前</p>
                            <span>25468评论</span>
                        </div>
                    </div>
                </div>-->
            </div>
        </div>
        <div class="match-data">
            <div class="common-title">
                <h6>数据统计</h6>
            </div>
            <div class="data-table" id="dataTable">
                <!--<div class="table-thead">
                    <p class="w1">球队</p>
                    <p class="w2">Q1</p>
                    <p class="w2">Q2</p>
                    <p class="w2">Q3</p>
                    <p class="w2">Q4</p>
                    <p class="w2">OT1</p>
                    <p class="w2">OT2</p>
                    <p class="w3">总分</p>
                </div>
                <div class="table-tbody">
                    <ul id="sumList">
                        <li>
                            <p class="w1">澳门大学澳门大学澳</p>
                            <p class="w2">Q1</p>
                            <p class="w2">Q2</p>
                            <p class="w2">Q3</p>
                            <p class="w2">Q4</p>
                            <p class="w2">OT1</p>
                            <p class="w2">OT2</p>
                            <p class="w3">100</p>
                        </li>
                        <li>
                            <p class="w1">澳门大学</p>
                            <p class="w2">Q1</p>
                            <p class="w2">Q2</p>
                            <p class="w2">Q3</p>
                            <p class="w2">Q4</p>
                            <p class="w2">OT1</p>
                            <p class="w2">OT2</p>
                            <p class="w3">100</p>
                        </li>
                    </ul>
                </div>-->
            </div>
        </div>
        <div class="match-data-king">
            <div class="common-title">
                <h6>本场数据帝</h6>
            </div>
            <div class="data-king">
                <ul id="kingData">
                    <!--<li>
                        <div class="kinds-user">
                            <div class="user">
                                <div class="user-img bg-cover mr20"
                                     style="background: url('../../image/img-tx.png')"></div>
                                <p class="user-name">迈克尔·乔丹</p>
                            </div>
                            <span class="mark">23</span>
                        </div>
                        <div class="txt">得分</div>
                        <div class="kinds-user">
                            <span class="mark">23</span>
                            <div class="user">
                                <p class="user-name">迈克尔·乔丹</p>
                                <div class="user-img bg-cover ml20"
                                     style="background: url('../../image/img-tx.png')"></div>
                            </div>
                        </div>
                    </li>-->
                </ul>
            </div>
        </div>
        <div class="skill-statistics">
            <div class="common-title">
                <h6>技术统计</h6>
            </div>
            <div class="statistics">
                <ul id="skillHtml">
                    <!--<li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">二分%</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">三分%</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">罚球%</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">前板</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">后板</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">盖帽</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">助攻</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">抢断</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">失误</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>
                    <li>
                        <div class="data-info">
                            <span class="mark">23</span>
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                        </div>
                        <div class="txt">犯规</div>
                        <div class="data-info">
                            <div class="bar-line">
                                <div class="percentage" style="width: 30%;"></div>
                            </div>
                            <span class="mark">23</span>
                        </div>
                    </li>-->
                </ul>
            </div>
        </div>
    </div>
    <div class="section" style="display: none">
        <div class="match-address"><p class="icon" id="address">暂无地址信息</p></div>
        <div class="two-teams" id="two_teams">
            <div class="team-detail">
                <h6 class="school-name" id="school_name1"></h6>
                <div class="team-coach">
                    <h6>教练</h6>
                    <div class="coach-list" id="coach-list1">
                        <!--<div class="coach-info mb10">
                            <div class="coach-img bg-cover" style="background: url('../../icon/Icon.png')"></div>
                            <p class="coach-name">加雷卡</p>
                        </div>-->
                    </div>

                </div>
                <div class="team-scroll">
                    <ul class="team-label">
                        <li class="wt1">团队成员</li>
                        <li class="wt2">时间</li>
                        <li class="wt2">得分</li>
                        <li class="wt2">篮板</li>
                        <li class="wt2">助攻</li>
                        <li class="wt2">投篮</li>
                        <li class="wt2">三分</li>
                        <li class="wt2">罚球</li>
                        <li class="wt2">前板</li>
                        <li class="wt2">后板</li>
                        <li class="wt2">抢断</li>
                        <li class="wt2">盖帽</li>
                        <li class="wt2">失误</li>
                        <li class="wt2">犯规</li>
                        <li class="wt2">+/-</li>
                    </ul>
                    <ol class="team-item" id="item_list1">
                        <!--<li>
                            <div class="wt1">
                                <div class="member-info">
                                    <div class="info-img bg-cover" style="background: url('../../icon/Icon.png')"></div>
                                    <div class="info">
                                        <p>迈克尔·乔丹</p>
                                        <p><span class="mr20">01</span> 得分后卫</p>
                                    </div>
                                </div>
                            </div>
                            <div class="wt2">22</div>
                            <div class="wt2">33</div>
                            <div class="wt2">21</div>
                            <div class="wt2">23</div>
                            <div class="wt2">42</div>
                            <div class="wt2">51</div>
                            <div class="wt2">23</div>
                            <div class="wt2">42</div>
                            <div class="wt2">12</div>
                            <div class="wt2">2</div>
                            <div class="wt2">5</div>
                            <div class="wt2">12</div>
                            <div class="wt2">24</div>
                            <div class="wt2">9</div>
                        </li>-->
                    </ol>

                </div>
            </div>
            <div class="team-detail">
                <h6 class="school-name" id="school_name2"></h6>
                <div class="team-coach">
                    <h6>教练</h6>
                    <div class="coach-list" id="coach-list2">
                        <!--<div class="coach-info mt10">
                            <div class="coach-img bg-cover" id="coach_icon2"
                                 style="background: url('../../icon/Icon.png')"></div>
                            <p class="coach-name" id="coach_name2">加雷卡</p>
                        </div>-->
                    </div>
                </div>
                <div class="team-scroll">
                    <ul class="team-label">
                        <li class="wt1">团队成员</li>
                        <li class="wt2">时间</li>
                        <li class="wt2">得分</li>
                        <li class="wt2">篮板</li>
                        <li class="wt2">助攻</li>
                        <li class="wt2">投篮</li>
                        <li class="wt2">三分</li>
                        <li class="wt2">罚球</li>
                        <li class="wt2">前板</li>
                        <li class="wt2">后板</li>
                        <li class="wt2">抢断</li>
                        <li class="wt2">盖帽</li>
                        <li class="wt2">失误</li>
                        <li class="wt2">犯规</li>
                        <li class="wt2">+/-</li>
                    </ul>
                    <ol class="team-item" id="item_list2">
                        <!--<li>
                            <div class="wt1">
                                <div class="member-info">
                                    <div class="info-img bg-cover" style="background: url('../../icon/Icon.png')"></div>
                                    <div class="info">
                                        <p>迈克尔·乔丹</p>
                                        <p><span class="mr20">01</span> 得分后卫</p>
                                    </div>
                                </div>
                            </div>
                            <div class="wt2">22</div>
                            <div class="wt2">33</div>
                            <div class="wt2">21</div>
                            <div class="wt2">23</div>
                            <div class="wt2">42</div>
                            <div class="wt2">51</div>
                            <div class="wt2">23</div>
                            <div class="wt2">42</div>
                            <div class="wt2">12</div>
                            <div class="wt2">2</div>
                            <div class="wt2">5</div>
                            <div class="wt2">12</div>
                            <div class="wt2">24</div>
                            <div class="wt2">9</div>
                        </li>-->
                    </ol>
                </div>
            </div>
        </div>

    </div>
</div>

<!--评论通用-->
<div class="photoViewerCommon">
    <div class="swiper-container photoViewer-common">
        <ul class="swiper-wrapper">
            <!--<li class="swiper-slide"><img src="../../image/banner01.png" alt=""></li>-->
            <li class="swiper-slide" onclick="closeViewCommon()"><img onclick="showViewCommon(event)" id="currentPic" class="swiper-lazy" src="" alt=""><div class="swiper-lazy-preloader"></div></li>
        </ul>
        <div class="photoViewer-bottom">
            <div onclick="closeViewCommon()" class="closeViewer"></div>
            <div class="swiper-pagination"></div>
            <div onclick="downloadPicCommon(event)" class="download"></div>
        </div>
    </div>
</div>

</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/zy.media.min.css"/>
<script type="text/javascript" src="../../script/zy.media.min.js"></script>
<script type="text/javascript" src="../../script/detailSwiper.js"></script>
<script type="text/javascript" src="../../script/comment.js"></script>

<script type="text/javascript">
    var match_id = '';//比赛id
    var type = 2;//类型：1 评论 2赛况 3阵容
    var live_status = '';//直播状态
    var live_url = '';//直播链接
    var video_id = 0;
    var msgImg_id = 0;
    apiready = function () {
        $api.fixStatusBar($api.dom('#header'));
        api.setStatusBarStyle({
            style: 'light', //设置APP状态栏字体色
            color: 'rgba(255,255,255,0)', //设置APP状态栏背景色
        });
        //setFixStatusBar(); //设置状态栏
        pop.loading();
        keybackListener()
        match_id = api.pageParam.match_id;
        // match_id = 42;

        getMatchDetails();

        api.addEventListener({
            name: 'aite'
        }, function(ret, err) {
            console.log(JSON.stringify(ret.value));
            var mid = ret.value.id;
            var mname = ret.value.name;
            var mUrl = '../activity/person_index';
            var m_id = {member_id: mid}
            var word = '<span style="display: inline; color: #ff7777;" class="aite" data-id="'+mid+'" onclick=\'commonUrl("'+mUrl+'",'+jsonChange(m_id)+')\'>@'+mname+'</span>　';
            // $("#article").append(word);
            checkSystemType(function () {
                $("#article").append(word);
            },function () {
                _insertimg(word)
            });
        });

    };

    function toAllList() {
        //type: 1新闻，2帖子，3活动贴，4赛事，5战况，6投票，7广场评星
        getAllList(4,match_id)
    }


    //二级评论获取评论目标
    var _input = $("#inputContent");
    var _editModel = $(".edit-model");
    var _article = $("#article");
    _input.click(function () {
        _editModel.show();
        var html = _article.html()
        _article.html('').focus();
    });

    function reply(id, name) {
        var pid = id;
        _input.attr('placeholder', '回复：' + name);
        _input.attr('data-pid', pid);
        _editModel.show();
        _article.focus();
        console.log(pid)
    }

    /*_article.blur(function () {
        if (_article.html() == '' || msgImg_id != 0) {
            _input.val('');
            _input.attr('placeholder', '写评论...');
            _input.attr('data-pid', '');
        }
    });*/


    //关闭评论框
    _editModel.on('click', function () {
        _input.val('');
        _input.attr('placeholder', '写评论...');
        _input.attr('data-pid', '');
        _editModel.hide()
    });
    //阻止事件冒泡 关闭评论框
    _editModel.on('click', '.edit-input', function (event) {
        event.stopPropagation()
        /*_article.focus();*/
    });

    //评论
    var addStatus = true;
    function comment_add() {
        var pid = '', type = 4;
        if (_input.attr('data-pid')) {
            pid = _input.attr('data-pid');
            type = 0;
        }
        var uidsArr = [];
        $("#article .aite").each(function () {
            var _this = $(this);
            var _thisId = _this.attr('data-id');
            uidsArr.push(_thisId);
        });
        var param = {
            token: $api.getStorage('token'),
            type: type,//类型：1新闻 2帖子 3活动 0回复 4赛事，5战况，6投票，7广场
            key_id: match_id,
            content: _article.html(),
            pid: pid,//当type为0的时候必须传入,二级回复，就是评论的id
            icon: msgImg_id,
            void_id: video_id,
            uids: uidsArr.toString()
        }
        if (!isDefine(param.content)&&!isDefine(param.icon)&&!isDefine(param.void_id)) {
            pop.notice('请发表你的评论内容');
            return false;
        }
        if(addStatus == false){
            return;
        }
        console.log(jsonChange(param));
        // return;
        pop.loading();
        getAjax(Interface.comment_add, param, function (res) {
            addStatus = false;

            _editModel.hide();
            _article.html('');
            _input.attr('placeholder', '写评论...');
            _input.attr('data-pid', '');

            $("#msgImg").siblings('img').attr('src','').removeAttr('data-id');
            $("#msgImg").hide();
            msgImg_id = 0;
            video_id = 0;

            pop.notice(res.msg)
            pop.close();
            setTimeout(function () {
                getMatchDetails()
                addStatus = true;
            }, 1500)
        }, function (error) {
            pop.notice(error.msg)
            pop.close();
        })
        _article.blur();//失去焦点
    }


    //直播链接
    function toUrlvideo() {
        //playStatus = 1 无视频无链接，2有视频有链接，3无视频有链接，4有视频无链接
        if(playStatus == 1){
            return;
        }else if(playStatus == 2){
            api.actionSheet({
                title: '选择观看方式',
                cancelTitle: '取消',
                buttons: ['跳转链接观看', '观看视频']
            }, function (ret, err) {
                if (ret) {
                    if (ret.buttonIndex == 1) {
                        console.log(live_url)

                        if (isDefine(live_url)) {
                            openURLInApp(live_url)
                        } else {
                            pop.notice('暂无直播')
                        }
                    } else if (ret.buttonIndex == 2) {

                        if(isDefine(videoUrl)){
                            if(api.systemType == 'ios'){
                                play(videoUrl)
                            }else {
                                $(".match_view").show().css({
                                    zIndex: 100
                                }).find('.match_video').html(videoHtml)
                                doZyMediaJs(1)
                            }
                        }else {
                            pop.notice('暂无视频')
                        }

                    }
                }
            });
        }else if(playStatus == 3){
            api.actionSheet({
                title: '选择观看方式',
                cancelTitle: '取消',
                buttons: ['跳转链接观看']
            }, function (ret, err) {
                if (ret) {
                    if (ret.buttonIndex == 1) {
                        console.log(live_url)

                        if (isDefine(live_url)) {
                            openURLInApp(live_url)
                        } else {
                            pop.notice('暂无直播')
                        }
                    }
                }
            });

        }else if(playStatus == 4){
            api.actionSheet({
                title: '选择观看方式',
                cancelTitle: '取消',
                buttons: ['观看视频']
            }, function (ret, err) {
                if (ret) {
                    if (ret.buttonIndex == 1) {
                        if(isDefine(videoUrl)){
                            if(api.systemType == 'ios'){
                                play(videoUrl)
                            }else {
                                $(".match_view").show().css({
                                    zIndex: 100
                                }).find('.match_video').html(videoHtml)
                                doZyMediaJs(1)
                            }
                        }else {
                            pop.notice('暂无视频')
                        }
                    }
                }
            });
        }

    }

    $(".match_view").on('click','.video_close',function () {
        $(".match_view").hide().css({
            zIndex: 98
        }).find('.match_video').html('')
    });

    var videoUrl = '';
    var videoHtml = '';

    var playStatus = 0;
    //获取比赛信息
    function getMatchDetails() {
        var param = {
            token: $api.getStorage('token'),
            match_id: match_id,//比赛id
        }
        getAjax(Interface.match_details, param, function (res) {

            var data = res.data;
            if (isDefine(data)) {
                var teamData = res.data.data;
                if (isDefine(teamData)) {

                    //比赛信息
                    $("#match_time").html(data.start_date +' '+data.start_day)
                    $("#match_name").html(data.title)
                    $("#match_score").html(teamData[0].branch + ' - ' + teamData[1].branch);

                    live_status = data.status;
                    if(isDefine(data.url)){
                        live_url = data.url;
                    }

                    if(isDefine(data.void_ids)){
                        videoUrl = ajaxUrl + data.void_ids;
                        videoHtml = '<video id="video" poster="'+ ajaxUrl + data.void_icon_path+'">' +
                            '                <source src="'+ ajaxUrl + data.void_ids+'" type="video/mp4" />' +
                            '            </video>'
                        $('.match_video').html(videoHtml);
                        doZyMediaJs(1)
                    }
                    //比赛状态

                    if (data.status == 1) {
                        playStatus = 1;
                        $("#match_status").removeClass('status1').addClass('status2');
                        $("#match_status_text").html('未开始');
                        $("#remind").show();
                        if (data.remind_status == 1) {
                            $(".action-btn-ld").addClass('on');
                        } else{
                            $(".action-btn-ld").removeClass('on');
                        }

                    } else if (data.status == 2) {
                        playStatus = 1;
                        $("#match_status").removeClass('status2').addClass('status1');
                        $("#match_status_text").html('进行中').addClass('nolive');

                        $(".action-btn-ld").remove()

                    } else if (data.status == 3) {

                        playStatus = 1;//1 无视频无链接，2有视频有链接，3无视频有链接，4有视频无链接
                        $("#match_status").removeClass('status1').addClass('status2');
                        $("#match_status_text").html('已结束').addClass('nolive');

                        $(".action-btn-ld").remove()

                    } else if (data.status == 4) {

                        playStatus = 2;
                        $("#match_status").removeClass('status2').addClass('status1');
                        $("#match_status_text").html('直播中');

                        if(isDefine(data.void_ids) && !isDefine(data.url)){
                            playStatus = 4;
                            $("#match_status").removeClass('status2').addClass('status1');
                            $("#match_status_text").html('进行中');
                        }else if(!isDefine(data.void_ids) && isDefine(data.url)){
                            playStatus = 3;
                            $("#match_status").removeClass('status2').addClass('status1');
                            $("#match_status_text").html('直播中');
                        }

                        $(".action-btn-ld").remove()

                    } else if (data.status == 5) {
                        playStatus = 2;
                        $("#match_status").removeClass('status2').addClass('status1');
                        $("#match_status_text").html('视频回放');

                        if(isDefine(data.void_ids) && !isDefine(data.url)){
                            playStatus = 4;
                        }else if(!isDefine(data.void_ids) && isDefine(data.url)){
                            playStatus = 3;
                        }

                        $(".action-btn-ld").remove()
                    }

                    if(isDefine(data.background_path)){
                        $("#match_bg").css({background: 'url(' + ajaxUrl + data.background_path + ') center no-repeat'})
                    } else {
                        $("#match_bg").css({background: 'url(../../image/bg-match-logo.png) center no-repeat'})
                    }
                    $("#address").html(data.address)
                    $("#msg").html(data.comment_number)

                    //左侧球队
                    $("#team1").attr('data-id', teamData[0].team_id);
                    $("#team1_icon").css({background: 'url(' + ajaxUrl + teamData[0].team_path + ')'})
                    // $("#team1_icon").attr('src', ajaxUrl + teamData[0].team_path);
                    $("#team1_name").html(teamData[0].team_title);
                    //右侧球队
                    $("#team2").attr('data-id', teamData[1].team_id);
                    $("#team2_icon").css({background: 'url(' + ajaxUrl + teamData[1].team_path + ')'})
                    // $("#team2_icon").attr('src', ajaxUrl + teamData[1].team_path);
                    $("#team2_name").html(teamData[1].team_title);


                    //赛事收藏
                    if(isDefine(data.collect_status)){
                        if(data.collect_status == 1){
                            $("#collect").addClass('on').html(data.collection_number)
                        }else {
                            $("#collect").removeClass('on').html(data.collection_number)
                        }
                    }
                    //赛事点赞
                    if(isDefine(data.fabulous_status)){
                        if(data.fabulous_status == 1){
                            $("#love").addClass('on').html(data.fabulous_number)
                        }else {
                            $("#love").removeClass('on').html(data.fabulous_number)
                        }
                    }
                }
            }
            getMatchData()
            pop.close();
        }, function (error) {
            pop.notice(error.msg);
            pop.close();
        })
    }

    //获取比赛数据
    function getMatchData() {

        var param = {
            token: $api.getStorage('token'),
            match_id: match_id,//比赛id
            type: type,//类型：1 评论 2赛况 3阵容
        }
        pop.loading();
        getAjax(Interface.match_xia, param, function (res) {
            // console.log(jsonChange(res))
            var data = res.data;

            if (isDefine(data)) {
                if (type == 1) {

                    var comment = data.comment;
                    var commentHtml = '';
                    if (isDefine(comment)) {

                        commentHtml = getEvaluteList(comment,match_id)

                        $("#commentHtml").html(commentHtml)

                    } else {
                        $("#commentHtml").html(noData)
                    }


                } else if (type == 2) {
                    var war = data.war;//战况
                    var warHtml = '';
                    if (isDefine(war)) {
                        var war_id = {"war_id": war.id}
                        warHtml = '<div class="outs-detail" tapmode onclick=\'commonUrl("match_detail",' + jsonChange(war_id) + ')\'>' +
                            '                    <div class="outs-img bg-cover" style="background: url(' + ajaxUrl + war.icons_path + ');"></div>' +
                            '                    <div class="outs-info">' +
                            '                        <p class="multiline-ellipsis_3 info">' + war.title + '</p>' +
                            '                        <div class="flex-div">' +
                            '                            <p>' + war.date + '</p>' +
                            '                            <span>' + war.comment_number + '评论</span>' +
                            '                        </div>' +
                            '                    </div>' +
                            '                </div>';

                        $("#war").html(warHtml);
                    } else {
                        $("#war").html(noData)
                    }

                    var sum = data.sum;//数据统计
                    if (isDefine(sum)) {
                        var sumHtml1 = '';
                        var sumHtml2 = '';
                        var otitle1 = '',otitle2 = '',otitle3 = '';
                        $.each(sum, function (i, item) {
                            var ot1 = '',ot2 = '',ot3 = '';
                            if(isDefine(item.qt1)){
                                ot1 = '<p class="w2">' + item.qt1 + '</p>';
                                otitle1 = '<p class="w2">OT1</p>';
                            }
                            if(isDefine(item.qt2)){
                                ot2 = '<p class="w2">' + item.qt2 + '</p>';
                                otitle2 = '<p class="w2">OT2</p>';
                            }
                            if(isDefine(item.qt3)){
                                ot3 = '<p class="w2">' + item.qt3 + '</p>';
                                otitle3 = '<p class="w2">OT3</p>';
                            }
                            if(i == 0){
                                sumHtml1 = '<li>' +
                                    '          <p class="w1">' + item.team_title + '</p>' +
                                    '          <p class="w2">' + item.q1 + '</p>' +
                                    '          <p class="w2">' + item.q2 + '</p>' +
                                    '          <p class="w2">' + item.q3 + '</p>' +
                                    '          <p class="w2">' + item.q4 + '</p>' + ot1 + ot2 + ot3 +
                                    '          <p class="w3">' + item.sum + '</p>' +
                                    '       </li>';
                            }else {

                                sumHtml2 = '<li>' +
                                    '          <p class="w1">' + item.team_title + '</p>' +
                                    '          <p class="w2">' + item.q1 + '</p>' +
                                    '          <p class="w2">' + item.q2 + '</p>' +
                                    '          <p class="w2">' + item.q3 + '</p>' +
                                    '          <p class="w2">' + item.q4 + '</p>' + ot1 + ot2 + ot3 +
                                    '          <p class="w3">' + item.sum + '</p>' +
                                    '       </li>';
                            }
                        })
                        var html = '<div class="table-thead">' +
                            '                    <p class="w1">球队</p>' +
                            '                    <p class="w2">Q1</p>' +
                            '                    <p class="w2">Q2</p>' +
                            '                    <p class="w2">Q3</p>' +
                            '                    <p class="w2">Q4</p>' + otitle1 + otitle2 + otitle3 +
                            '                    <p class="w3">总分</p>' +
                            '                </div>' +
                            '                <div class="table-tbody">' +
                            '                    <ul id="sumList">' + sumHtml1 + sumHtml2 + '</ul>' +
                            '                </div>'

                        $("#dataTable").html(html);
                    } else {
                        $("#dataTable").html(noData)
                    }


                    var thisData = data.data;//本次数据帝
                    if (isDefine(thisData)) {
                        var team1 = thisData[0];
                        var team2 = thisData[1];
                        var kingHtml = '';
                        $.each(team1, function (i, item) {

                            if(i == 0){
                                kingHtml += '<li>' +
                                    '                        <div class="kinds-user">' +
                                    '                            <div class="user">' +
                                    '                                <div class="user-img bg-cover mr20"' +
                                    '                                     style="background: url(' + ajaxUrl + item.player_icon_path + ')"></div>' +
                                    '                                <p class="user-name">' + item.player_title + '</p>' +
                                    '                            </div>' +
                                    '                            <span class="mark">' + item.score + '</span>' +
                                    '                        </div>' +
                                    '                        <div class="txt">得分</div>' +
                                    '                        <div class="kinds-user">' +
                                    '                            <span class="mark">' + team2[i].score + '</span>' +
                                    '                            <div class="user">' +
                                    '                                <p class="user-name">' + team2[i].player_title + '</p>' +
                                    '                                <div class="user-img bg-cover ml20"' +
                                    '                                     style="background: url(' + ajaxUrl + team2[i].player_icon_path + ')"></div>' +
                                    '                            </div>' +
                                    '                        </div>' +
                                    '                    </li>'
                            }else if(i == 1) {
                                kingHtml += '<li>' +
                                    '                        <div class="kinds-user">' +
                                    '                            <div class="user">' +
                                    '                                <div class="user-img bg-cover mr20"' +
                                    '                                     style="background: url(' + ajaxUrl + item.player_icon_path + ')"></div>' +
                                    '                                <p class="user-name">' + item.player_title + '</p>' +
                                    '                            </div>' +
                                    '                            <span class="mark">' + item.score + '</span>' +
                                    '                        </div>' +
                                    '                        <div class="txt">篮板</div>' +
                                    '                        <div class="kinds-user">' +
                                    '                            <span class="mark">' + team2[i].score + '</span>' +
                                    '                            <div class="user">' +
                                    '                                <p class="user-name">' + team2[i].player_title + '</p>' +
                                    '                                <div class="user-img bg-cover ml20"' +
                                    '                                     style="background: url(' + ajaxUrl + team2[i].player_icon_path + ')"></div>' +
                                    '                            </div>' +
                                    '                        </div>' +
                                    '                    </li>'
                            }else if (i == 2){
                                kingHtml += '<li>' +
                                    '                        <div class="kinds-user">' +
                                    '                            <div class="user">' +
                                    '                                <div class="user-img bg-cover mr20"' +
                                    '                                     style="background: url(' + ajaxUrl + item.player_icon_path + ')"></div>' +
                                    '                                <p class="user-name">' + item.player_title + '</p>' +
                                    '                            </div>' +
                                    '                            <span class="mark">' + item.score + '</span>' +
                                    '                        </div>' +
                                    '                        <div class="txt">助攻</div>' +
                                    '                        <div class="kinds-user">' +
                                    '                            <span class="mark">' + team2[i].score + '</span>' +
                                    '                            <div class="user">' +
                                    '                                <p class="user-name">' + team2[i].player_title + '</p>' +
                                    '                                <div class="user-img bg-cover ml20"' +
                                    '                                     style="background: url(' + ajaxUrl + team2[i].player_icon_path + ')"></div>' +
                                    '                            </div>' +
                                    '                        </div>' +
                                    '                    </li>'
                            }



                        })

                        $("#kingData").html(kingHtml);
                    } else {
                        $("#kingData").html(noData)
                    }


                    var skill = data.skill;//技术统计
                    if (isDefine(skill)) {
                        var list1 = skill[0];
                        var list2 = skill[1];

                        var skillHtml = '<li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.two_branch + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.two_branch + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">二分%</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.two_branch + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.two_branch + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.three_branch + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.three_branch + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">三分%</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.three_branch + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.three_branch + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.penalty_ball + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.penalty_ball + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">罚球%</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.penalty_ball + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.penalty_ball + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.front_plate + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.front_plate + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">前板</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.front_plate + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.front_plate + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.after_plate + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.after_plate + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">后板</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.after_plate + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.after_plate + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.block_shot + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.block_shot + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">盖帽</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.block_shot + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.block_shot + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.assists + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.assists + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">助攻</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.assists + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.assists + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.steals + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.steals + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">抢断</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.steals + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.steals + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.an_error + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.an_error + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">失误</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.an_error + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.an_error + '</span>' +
                            '                        </div>' +
                            '                    </li>' +
                            '                    <li>' +
                            '                        <div class="data-info">' +
                            '                            <span class="mark">' + list1.foul + '</span>' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list1.foul + '%;"></div>' +
                            '                            </div>' +
                            '                        </div>' +
                            '                        <div class="txt">犯规</div>' +
                            '                        <div class="data-info">' +
                            '                            <div class="bar-line">' +
                            '                                <div class="percentage" style="width: ' + list2.foul + '%;"></div>' +
                            '                            </div>' +
                            '                            <span class="mark">' + list2.foul + '</span>' +
                            '                        </div>' +
                            '                    </li>';


                        $("#skillHtml").html(skillHtml)
                    } else {
                        $("#skillHtml").html(noData)
                    }


                } else if (type == 3) {

                    var school1 = data[0];
                    if (isDefine(school1)) {
                        if (isDefine(school1.coach)) {

                            var coachList = '';
                            $.each(school1.coach, function (i, item) {
                                $("#school_name1").html(item.school_title)
                                coachList = '<div class="coach-info mb10">' +
                                    '                        <div class="coach-img bg-cover" style="background: url('+ ajaxUrl + item.icon_path +')"></div>' +
                                    '                        <p class="coach-name">'+item.name+'</p>' +
                                    '                    </div>'
                            })
                            $("#coach-list1").html(coachList)
                        }
                        if (isDefine(school1.list)) {

                            var itemList = '';
                            $.each(school1.list, function (i, item) {
                                var player = item.player;
                                var playerData = item.data;
                                itemList += '<li>' +
                                    '                        <div class="wt1">' +
                                    '                            <div class="member-info">' +
                                    '                                <div class="info-img bg-cover" style="background: url('+ajaxUrl+player.icon_path+')"></div>' +
                                    '                                <div class="info">' +
                                    '                                    <p>'+player.name+'</p>' +
                                    '                                    <p><span class="mr20">'+player.number+'</span> '+player.position+'</p>' +
                                    '                                </div>' +
                                    '                            </div>' +
                                    '                        </div>' +
                                    '                        <div class="wt2">'+playerData.miute+'</div>' +
                                    '                        <div class="wt2">'+playerData.score+'</div>' +
                                    '                        <div class="wt2">'+playerData.backboard+'</div>' +
                                    '                        <div class="wt2">'+playerData.assists+'</div>' +
                                    '                        <div class="wt2">'+playerData.shoot+'</div>' +
                                    '                        <div class="wt2">'+playerData.three_points+'</div>' +
                                    '                        <div class="wt2">'+playerData.penalty_ball+'</div>' +
                                    '                        <div class="wt2">'+playerData.front_plate+'</div>' +
                                    '                        <div class="wt2">'+playerData.rear_plate+'</div>' +
                                    '                        <div class="wt2">'+playerData.steals+'</div>' +
                                    '                        <div class="wt2">'+playerData.block_shot+'</div>' +
                                    '                        <div class="wt2">'+playerData.an_error+'</div>' +
                                    '                        <div class="wt2">'+playerData.foul+'</div>' +
                                    '                        <div class="wt2">'+playerData.add_cut+'</div>' +
                                    '                    </li>';

                            })
                            $("#item_list1").html(itemList)
                        }else {
                            $("#item_list1").html('<li><div class="wt1">暂无队员数据</div></li>')
                        }

                    }

                    var school2 = data[1];
                    if (isDefine(school2)) {
                        if (isDefine(school2.coach)) {
                            var coachList = '';
                            $.each(school2.coach, function (i, item) {
                                $("#school_name2").html(item.school_title)
                                coachList = '<div class="coach-info mb10">' +
                                    '                        <div class="coach-img bg-cover" style="background: url('+ ajaxUrl + item.icon_path +')"></div>' +
                                    '                        <p class="coach-name">'+item.name+'</p>' +
                                    '                    </div>'
                            })
                            $("#coach-list2").html(coachList)

                        }
                        if (isDefine(school2.list)) {

                            var itemList = '';
                            $.each(school2.list, function (i, item) {
                                var player = item.player;
                                var playerData = item.data;
                                itemList += '<li>' +
                                    '                        <div class="wt1">' +
                                    '                            <div class="member-info">' +
                                    '                                <div class="info-img bg-cover" style="background: url('+ajaxUrl+player.icon_path+')"></div>' +
                                    '                                <div class="info">' +
                                    '                                    <p>'+player.name+'</p>' +
                                    '                                    <p><span class="mr20">'+player.number+'</span> '+player.position+'</p>' +
                                    '                                </div>' +
                                    '                            </div>' +
                                    '                        </div>' +
                                    '                        <div class="wt2">'+playerData.miute+'</div>' +
                                    '                        <div class="wt2">'+playerData.score+'</div>' +
                                    '                        <div class="wt2">'+playerData.backboard+'</div>' +
                                    '                        <div class="wt2">'+playerData.assists+'</div>' +
                                    '                        <div class="wt2">'+playerData.shoot+'</div>' +
                                    '                        <div class="wt2">'+playerData.three_points+'</div>' +
                                    '                        <div class="wt2">'+playerData.penalty_ball+'</div>' +
                                    '                        <div class="wt2">'+playerData.front_plate+'</div>' +
                                    '                        <div class="wt2">'+playerData.rear_plate+'</div>' +
                                    '                        <div class="wt2">'+playerData.steals+'</div>' +
                                    '                        <div class="wt2">'+playerData.block_shot+'</div>' +
                                    '                        <div class="wt2">'+playerData.an_error+'</div>' +
                                    '                        <div class="wt2">'+playerData.foul+'</div>' +
                                    '                        <div class="wt2">'+playerData.add_cut+'</div>' +
                                    '                    </li>';

                            })
                            $("#item_list2").html(itemList)
                        }else {
                            $("#item_list2").html('<li><div class="wt1">暂无队员数据</div></li>')
                        }

                    }


                }


            } else {

                if(type == 3){

                    $("#two_teams").html(noData)
                }


            }

            pop.close();
        }, function (error) {
            pop.notice(error.msg);
            pop.close();
        })
    }

    //添加收藏、取消收藏
    var toast = true
    function collect(that) {
        var _this = $(that);
        var pid = match_id;
        var type = 5;
        if(toast){
            if(_this.hasClass('on')){
                collection_cancel(type,pid,function (res) {
                    pop.notice('取消收藏')
                    _this.removeClass('on').html(parseInt(_this.html())-1)
                    pop.close()
                })
            }else {
                collection(type,pid,function (res) {
                    pop.notice('收藏成功')
                    _this.addClass('on').html(parseInt(_this.html())+1)
                    pop.close()
                })
            }
            toast = false;
            setTimeout(function () {
                toast = true;
            },1000)
        }

    }


    //点赞或者取消点赞 类型type：1新闻 2帖子 3活动 4评论
    function clickFabulous(f_stype, type, pid,event) {
        event.stopPropagation()
        //活动点赞
        if (type == 5) {
            pid = match_id;
            if ($('#love').hasClass('on')) {
                f_stype = 2
            } else {
                f_stype = 1
            }
        }
        fabulous(f_stype, type, pid, function (res) {
            if (f_stype == 1) {
                pop.notice('点赞成功')
            } else {
                pop.notice('取消点赞')
            }
            setTimeout(function () {
                getMatchDetails()
            }, 500)
        })
    }

    //很多战况
    function situation(path) {
        var param = {"match_id": match_id}
        commonUrl(path, param)

    }


    //添加提醒
    function addRemind(that) {
        if ($(that).hasClass('on')) {
            $(that).removeClass('on');
            remind(2)
        } else {
            $(that).addClass('on');
            remind(1)
        }
    }

    //关注赛事提醒
    function remind(type){
        var param = {
            token: $api.getStorage('token'),
            match_id: match_id,
            type: type,
        }
        getAjax(Interface.set_remind,param,function (res) {
            if(type == 1){
                pop.notice('已开启提醒')
            }else {
                pop.notice('已关闭提醒')
            }
            api.sendEvent({
                name: 'remind',
            });
        },function (error) {
            pop.notice(error.msg)
        })
    }


    ///跳转对应球队详情
    function teamDetail(that) {
        var team_id = $(that).attr('data-id');
        var param = {"team_id": team_id};
        commonUrl('team_detail', param)
    }


    $(function () {
        $(".match-detail-show").on('click', 'li', function () {
            var _this = $(this);
            var _index = _this.index();
            _this.addClass('on').siblings('li').removeClass('on');
            $(".match-section .section").eq(_index).show().siblings('.section').hide();
            type = parseInt(_index) + 1
            getMatchData()

        })
    })

    function _insertimg(str) {

        var selection = window.getSelection ? window.getSelection() : document.selection;

        var range = selection.createRange ? selection.createRange() : selection.getRangeAt(0);

        if (!window.getSelection) {

            document.getElementById('article').focus();

            var selection = window.getSelection ? window.getSelection() : document.selection;

            var range = selection.createRange ? selection.createRange() : selection.getRangeAt(0);

            range.pasteHTML(str);

            range.collapse(false);

            range.select();

        } else {

            document.getElementById('article').focus();

            range.collapse(false);

            var hasR = range.createContextualFragment(str);

            var hasR_lastChild = hasR.lastChild;

            while (hasR_lastChild && hasR_lastChild.nodeName.toLowerCase() == "br" && hasR_lastChild.previousSibling &&
            hasR_lastChild.previousSibling.nodeName.toLowerCase() == "br") {

                var e = hasR_lastChild;

                hasR_lastChild = hasR_lastChild.previousSibling;

                hasR.removeChild(e)

            }

            range.insertNode(hasR);

            if (hasR_lastChild) {

                range.setEndAfter(hasR_lastChild);

                range.setStartAfter(hasR_lastChild)

            }

            selection.removeAllRanges();

            selection.addRange(range)

        }

    }


</script>
